/*
 * Player.java
 *
 * Copyright(c) 2011 - Kimnach
 * See Main.java for copyright notice.
 *
 */

package main.model;

import java.awt.Color;

/**
 * Player class
 * @author dkimnach
 */
public class Player {

    private String name;
    private Color  color;

    boolean dead = false;

    /**
     * Constructs a new <code>Player</code> with [name] and [color]
     * @param name
     * @param color
     */
    public Player (String name, Color color) {
        this.name = name;
        this.color = color;
    }

    /**
     * Constructs a new <code>Player</code> with [name] and [color] and status of [dead?]
     * @param name
     * @param color
     * @param dead
     */
    public Player (String name, Color color, boolean dead) {
        this.name  = name;
        this.color = color;
        this.dead  = dead;
    }

    /**
     * Kill player
     */
    public void die () {
        dead = true;
    }

    /**
     * Revive player
     */
    public void revive () {
        dead = false;
    }

    /**
     * Check if dead
     * @return if dead
     */
    public boolean isDead () {
        return dead;
    }

    /**
     * Get player color
     * @return color
     */
    public Color getColor () {
        return color;
    }

    /**
     * Get player name
     * @return name
     */
    public String getName () {
        return name;
    }

    /**
     * Set player name
     * @param name player name
     */
    public void setName (String name) {
        this.name = name;
    }
}
